from core.basehandler import BaseHandler
from core.room import Room
from core.support import set_cutscene, get_game
from core.action import Action

class SecondFloorHallway(Room):
    def __init__(self, room_id):
        Room.__init__(self, room_id)
        
        # self.treasure_locked = True
        # self.add_item(Keys())
        self.add_action(GoToStarbucks)
        self.add_action(GoToThird)
        self.add_action(GoTo230A)
        self.add_action(Tapdance)
        self.add_action(LookDownFrom2)
    
    def get_description(self):
        desc = '''
        You make your way to the second floor hall and stop at the grand staircase. 
        The zombies below groan like wombats during mating season. 
        Note to self: Watch less Discovery Channel ...
        '''
        return desc
    
    def get_image(self):
        return 'Hallways.jpg'

class SecondFloorHallwayHandler(BaseHandler):
    def get_room_class(self):
        return SecondFloorHallway

class GoToStarbucks(Action):
    def __init__(self):
        Action.__init__(self, "GoToStarbucks")
    
    def get_description(self):
        return "Meander on to Starbucks"
    
    def get_destination(self):
        return 'starbucks'
    
    def get_method(self):
        return "get"

class GoToThird(Action):
    def __init__(self):
        Action.__init__(self, "GoToThird")
    
    def get_description(self):
        return "Walk up to the Third Floor"
    
    def get_destination(self):
        return 'thirdfloorhallway'
    
    def get_method(self):
        return "get"

class GoTo230A(Action):
    def __init__(self):
        Action.__init__(self, "GoTo230A")
    
    def get_description(self):
        return "Hit the Team Rooms!"
    
    def get_destination(self):
        return 'teamroom230a'
    
    def is_enabled(self):
        return 'room_booked' in get_game().get_player().status_changes;
    def get_method(self):
        return "get"

class LookDownFrom2(Action):
    def __init__(self):
        Action.__init__(self, "LookDownFrom2")
    
    def get_description(self):
        return "Look over the Edge"
    
    def get_destination(self):
        return 'lookdown2'
    
    def get_method(self):
        return "get"

class Tapdance(Action):
    def __init__(self):
        Action.__init__(self, "Tapdance")
    
    def get_description(self):
        return "Tapdance on the Stairwell"
    
    def do_action(self,game,room,request):
        set_cutscene("Tap-tap-tappy!  You tapdance up and down the steps like an idiot.")
        
    def get_method(self):
        return "post"